﻿using System.Web.UI;

public partial class Shared_UserControl_ErrorWindow : UserControl
{
    protected override void OnLoad(System.EventArgs e)
    {
        errMessages.Items.Clear();
        base.OnLoad(e);
    }

    /// <summary>
    /// 设置验证的组
    /// </summary>
    public string ValidationGroup
    {
        set
        {
            errSummary1.ValidationGroup = value;
        }
    }

    /// <summary>
    /// 添加错误信息
    /// </summary>
    /// <param name="message">错误信息</param>
    public void AddError(string message)
    {
        errMessages.Items.Add(message);
    }

    /// <summary>
    /// 显示窗口的脚本
    /// </summary>
    public string ScriptForShow
    {
        get
        {
            return string.Format("radalert($('#{0}').html(), 420, 150, '验证失败');", errPanel.ClientID);
        }
    }
}